package com.zed.api.useradmin;

/**
 * 登录凭证未找到时抛出的例外
 * @author Zed
 *
 */
public class LoginCertificateNotFoundException extends AccountException {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6308539183845303091L;
	private LoginCertificate certificate;
	/**
	 * 
	 */
	public LoginCertificateNotFoundException(LoginCertificate certificate) {
		super("login certificate is exists: domain=" + certificate.getDomain() + ", identifier=" + certificate.getIdentifier());
		this.certificate = certificate;
	}

	public LoginCertificate getLoginCertificate() {
		return this.certificate;
	}
	
	@Override
	public String getLocalizedMessage() {
		return String.format("未找到登录凭证[域=%s, 编号=%s]", this.getLoginCertificate().getDomain(), this.getLoginCertificate().getIdentifier());
	}
}
